home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / visds / sktest.dsc < prev    next >
Text File  |  1999-05-02  |  2KB  |  92 lines

  1. title SendKey Test
  2. %A = Wordpad
  3. %W = Document - Wordpad
  4. %Z = Save As
  5. if @winexists(%W)
  6.   window activate,%W
  7. else
  8.   run %A.EXE
  9.   wait 4
  10. end
  11. %W = @winexists(%W)
  12. file delete,test.txt
  13. wait 1
  14. window position,%W,84,480,400
  15. rem enter some text
  16. window send,%W,This is a test string@CR()
  17. gosub checkok
  18. window send,%W,The current directory is @curdir()@CR()
  19. gosub checkok
  20. window send,%W,@tab()This text is indented.@CR()
  21. gosub checkok
  22. window send,%W,@shift(and this text is in capitals)@cr()
  23. gosub checkok
  24. window send,%W,$123+ú456=ú789!!  5 > 4 = true?@CR()
  25. gosub checkOK
  26. window send,%W,The date is: @alt(I)D@CR()@cr()
  27. wait 1
  28. gosub checkok
  29. window send,%W,Let's copy some text to the clipboard...@CR()
  30. wait 1
  31. gosub checkok
  32. window send,%W,@ctrl(@key(home))@shift(@key(end)@key(down)@key(down)@key(down)@key(end))
  33. wait 1
  34. window send,%W,@ctrl(c)
  35. wait 1
  36. window send,%W,@ctrl(@key(end))
  37. wait 1
  38. window send,%W,... and insert the copied text here.@CR()
  39. wait 1
  40. gosub checkok
  41. window send,%W,@shift(@key(ins))
  42. window send,%W,@cr()@cr()
  43. wait 3
  44. window send,%W,Here are some accented characters:@CR()
  45. gosub checkok
  46. window send,%W,ÇατΦΘδε≡⌠∙°@chr(255)@CR()
  47. gosub checkok
  48. window send,%W,@CR()
  49. wait 2
  50. window send,%W,@CR()Now let's save the file.@CR()
  51. gosub checkok
  52. rem save the file as TEST.TXT
  53. window send,%W,@alt(F)A
  54. rem wait for Save As dialog
  55. %C = 1000
  56. repeat
  57.   %C = @pred(%C)
  58.   if @zero(%C)
  59.     warn Cannot find window %Z - aborting
  60.     exit
  61.   end
  62. until @winexists(%Z)
  63. wait 1
  64. window send,%Z,Test
  65. wait 2
  66. window send,Save As,@chr(27)
  67. wait 1
  68. window send,%W,Changed my mind!@CR()
  69. wait 2
  70. rem quit Notepad
  71. window send,%W,@alt(FX)
  72. %C = 1000
  73. repeat
  74.   %C = @pred(%C)
  75.   if @zero(%C)
  76.     warn Cannot find window %A - aborting
  77.     exit
  78.   end
  79. until @winexists(%A)
  80. wait 1
  81. rem select No option on dialog
  82. window send,%A,@alt(n)
  83. exit
  84.  
  85. :checkok
  86. if @not(@ok())
  87.     window send,%W,** The result of "@ok()" was false after the@CR()
  88.   window send,%W,** previous line was sent"," indicating that@CR()
  89.   window send,%W,** one or more of the characters was not@CR()
  90.   window send,%W,** a valid keyboard character.@CR()
  91. end
  92. exit